using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PS.WebParts.Rollup.GridViewWebPart
{
    public class NumberColumn 
        : FormattedColumn
    {
        internal override string GetFormatedString(object container)
        {
            object value = DataBinder.GetPropertyValue(container, DataField);

            if (null == value || value.ToString() == string.Empty)
            {
                return "";
            }

            Decimal d = Convert.ToDecimal(value);
            return d.ToString(format);
        }

        protected override DataControlField CreateField()
        {
            return new NumberColumn();
        }
     }
}

